package com.zyong.design.pattern.command.case2;

/**
 * @program: zyong-design-pattern
 * @ClassName: RefrigeratorOnCommand
 * @author: zyong
 * @create: 2024-03-27 22:07
 */
public class RefrigeratorOnCommand implements Command {
    private RefrigeratorReceiver refrigeratorReceiver;

    public RefrigeratorOnCommand(RefrigeratorReceiver refrigeratorReceiver) {
        this.refrigeratorReceiver = refrigeratorReceiver;
    }

    @Override
    public void execute() {
        refrigeratorReceiver.on();
    }

    @Override
    public void undo() {
        refrigeratorReceiver.off();
    }
}
